<?php
namespace Mapi\Controller;
use Think\Controller\RestController;

class LogController extends RestController {    

    protected $allowMethod    = array('get','post','put'); // REST允许的请求类型列表
    protected $allowType      = array('html','xml','json'); // REST允许请求的资源类型列表

    public function __construct() {
    	parent::__construct();

        $token = I('server.HTTP_USERTOKEN');
        $loginInfo = M('UserLoginInfo')->where(array('token' => $token))->find();
        $username = M('UserInfo')->where(array('uid' => $loginInfo['uid']))->getField('realname');
		setlog($username, CONTROLLER_NAME, ACTION_NAME);
    }
}